---
title: "Accessibility Checker Rule Help: HAAC_Combobox_Must_Have_Text_Input"
---
import "../../../styles/ToolHelp.scss"
import { CodeSnippet, Tag } from "carbon-components-react";

<div className="toolHelp">
<Row>
<Column colLg={16} colMd={8} colSm={4} className="toolHead">

### The text input `role` or number of lines is not valid for a combobox

<div id="locLevel"></div>

A combobox must have a single line text input element with a valid `role`

</Column>
</Row>
<Row>
<Column colLg={11} colMd={5} colSm={4} className="toolMain">

### Why is this important?

A combobox combines a text input element and a popup element that helps the user set the value of the input. The text input element must be a single line text field with an appropriate role, otherwise assistive technologies may not be able to present and control the content correctly.

<div id="locSnippet"></div>

### What to do

 * Code the combobox as in the WAI-ARIA 1.2 example below;
 * OR, if the text input element is multi-line (e.g. `<textarea>`), set `aria-multiline="false"`;
 * AND, ensure the text input element has `role="textbox"` or `role="searchbox"`. An `<input type="text">` element has the implicit role of `"textbox"`.

Alert: The guidance for combobox is changing significantly in WAI-ARIA 1.2 due to problems with implementation of the WAI-ARIA 1.1 pattern. The recommended combobox pattern for WAI-ARIA 1.2 is:

<CodeSnippet type="multi" light={true}> &lt;label for="tag_combo"&gt;Tag&lt;/label&gt;
  &lt;input type="text" id="tag_combo"
      role="combobox" aria-autocomplete="list"
      aria-haspopup="listbox" aria-expanded="true"
      aria-controls="popup_listbox" aria-activedescendant="selected_option"&gt;
   &lt;ul role="listbox" id="popup_listbox"&gt;
      &lt;li role="option"&gt;Zebra&lt;/li&gt;
      &lt;li role="option" id="selected_option"&gt;Zoom&lt;/li&gt;
   &lt;/ul&gt;</CodeSnippet>

Note, example code includes material copied from or derived from [W3C, Accessible Rich Internet Applications (WAI-ARIA) 1.2 W3C Working Draft 18 December 2019](https://www.w3.org/TR/wai-aria-1.2/#combobox). Copyright © [2013-2019] W3C® (MIT, ERCIM, Keio, Beihang).

</Column>
<Column colLg={5} colMd={3} colSm={4} className="toolLeft">

### About this requirement

[IBM 4.1.2 Name, Role, Value](https://www.ibm.com/able/requirements/requirements/#4_1_2)
[W3C WAI-ARIA v1.2 Authoring Practices - Combobox](https://www.w3.org/TR/wai-aria-1.2/#combobox)

### Who does this affect?

 * Blind people using screen readers
 * People with low vision using screen readers

</Column>
</Row>
</div>

export default ({ children, _frontmatter }) => (<React.Fragment>{children}</React.Fragment>)
